package pack0618;

import java.util.Scanner;

public class lianxi {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        System.out.println("随意输入两个整数");
        int x = num.nextInt();
        int y = num.nextInt();
        for (int i = x; i >= 1; i--) {
            if (x % i == 0 && y % i == 0) {
                System.out.println(i);
                break;
            }
        }
        for (int i = y; ; i++) {
            if (i%x==0&&i%y==0) {
                System.out.println(i);
                break;
            }
        }
    }
}